<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>主页</title>
    <!--引入核心css-->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
    <!--更好的更好的响应式支持-->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<hr>
<div class="container">
    <div class="row">
        <div class="col-12">
            <h3>选择Excle文件导入</h3>
            <form class="form-inline" method="post" action="importExcel" enctype="multipart/form-data">
                <input type="file" class="form-control" name="file">
                <input type="submit" class="btn btn-danger" value="导入">
            </form>
        </div>
        <br>
        <div class="col-12">
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>姓名</th>
                    <th>部门</th>
                    <th>性别</th>
                    <th>工龄</th>
                    <th>出生日期</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="user:${users}">
                    <td th:text="${user.userId}"></td>
                    <td th:text="${user.userName}"></td>
                    <td th:text="${user.department.deptName}"></td>
                    <td th:if="${user.sex == 1}">男</td>
                    <td th:if="${user.sex == 0}">女</td>
                    <td th:text="${user.workAge}"></td>
                    <td th:text="${#dates.format(user.birthday,'yyyy-MM-dd')}"></td>
                </tr>
                </tbody>
            </table>
            <br>
            <a href="exportExcel" class="btn btn-success btn-sm">导出</a>
        </div>

        <!--分页-->
    </div>
</div>
</body>
</html>